﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using nyxwin.Main.Base.ViewModels;
using nyxwin.Common.Silverlight.Commands;

namespace nyxwin.Main.ViewModel.SubModels
{
    public class BookMarkModel : BaseViewModel
    {
        public BookMarkModel(Data.Bookmarks.Bookmark book)
        {
            this.DiscussionId = book.DiscussionId;
            this.CategoryId = book.CategoryId;
            this.Replies = book.Replies;
            this.Unread = book.Unread ?? 0;
            this.Title = book.Title;
            this.OpenCommand = new Command(x =>
            {
                Navigate(new Uri("/View/SubViews/Discussion.xaml?id=" + this.DiscussionId, UriKind.Relative));
            });
        }

        public int DiscussionId { get; private set; }
        public int? CategoryId { get; private set; }
        public int? Replies { get; private set; }
        public int Unread { get; private set; }
        public string Title { get; private set; }
        public Command OpenCommand { get; private set; }
    }
}
